package com.base.pig.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;

import com.base.pig.entity.ScAnnotation;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;

import java.util.List;

/**
 * @ProjectName intelligent-city
 * @Package com.pig4cloud.pig.lab.annotation.mapper
 * @ClassName ScAnnotationMapper
 * @Description TODO
 * @Company lab
 * @Author zgq
 * @Date 2020/7/13 19:19
 * @UpdateUser
 * @UpdateDate
 * @UpdateRemark
 * @Version 1.0.0
 */
@Mapper
public interface ScAnnotationMapper extends BaseMapper<ScAnnotation> {
    @Update({"<script>",
            "update sc_annotation set state = #{state} where id in",
            "<foreach collection='ids' item='id' open='(' separator=',' close=')'>",
            "#{id}",
            "</foreach>",
            "</script>"})
    int updateStateByIds(@Param("ids") List<Long> ids,@Param("state") int state);
}
